perm filename FIXP2.FAI[SS,SYS]2 blob sn#410562 filedate 1979-01-17 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00002 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002		TITLE FIXP2 PROGRAM TO DECLARE P2 UP
C00005 ENDMK
C⊗;
	TITLE FIXP2 PROGRAM TO DECLARE P2 UP

COMMENT ⊗ This program is NOT the thing to do if you just want to
reload the KA-10.  This program is used if P2 has been declared
"permanently" down because its memory was nonexistent during SYSINI,
or because the operator asked for it to be down, and you now want
to allow it to be brought up.  The program requires the DEV privilege.
NOTE THAT IF THE KA'S MEMORY IS REALLY STILL DOWN THIS PROGRAM WILL
CRASH THE (KL) SYSTEM!!!  ⊗

A←1
B←2

DEVPRV←←400

ISDOWN:	OUTSTR [ASCIZ /P2's memory is currently down.
/]
	SETZM ISUP
	JRST BACK

START:	RESET
	P2UUO 0,
	 JRST ISDOWN
	SETOM ISUP#
	OUTSTR [ASCIZ /P2's memory is currently up.../]
	MOVEI B,[ASCIZ / and P2 is running.
/]
	P2UUO 1,
	 MOVEI B,[ASCIZ / but P2 is not running.
/]
	OUTSTR (B)
BACK:	MOVSI A,DEVPRV
	SETPRV A,
	TLNN A,DEVPRV
	JRST NOPRIV
	CLRBFI
	OUTSTR [ASCIZ /Do you want P2 Up or Down?  /]
UORD:	INCHWL A
	CLRBFI
	CAIL A,140
	SUBI A,40
	CAIN A,"U"
	JRST UP
	CAIN A,"D"
	JRST DOWN
	OUTSTR [ASCIZ /
Type U or D.  /]
	JRST UORD

UP:	SKIPE ISUP		;ALREADY UP?
	JRST OKBOSS
	OUTSTR [ASCIZ /Are you sure?  This will crash the system if the
KA-10's memory is down!  /]
	INCHWL A
	CLRBFI
	CAIE A,"Y"
	CAIN A,"y"
	JRST YES
	EXIT

OKBOSS:	OUTSTR [ASCIZ /Right.
/]
	EXIT

YES:	P2UUO 2,	;DO IT
	OUTSTR [ASCIZ /OK, now reload P2.
/]
	EXIT

DOWN:	SKIPN ISUP
	JRST OKBOSS
	P2UUO 3,	;DOWN
	 JRST NODOWN	;FAILED
	OUTSTR [ASCIZ /P2 is now down.
/]
	EXIT

NODOWN:	OUTSTR [ASCIZ /Not enough memory to allow taking down P2.
/]
	EXIT

NOPRIV:	OUTSTR [ASCIZ /You must have the DEV privilege to change P2's status.
/]
	EXIT

	END START